package cn.tedu.boot08.mapper;

import cn.tedu.boot08.entity.Banner;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BannerMapper {
    @Insert("INSERT INTO banner VALUES(NULL,#{url},#{des})")
    void insert(Banner banner);
    @Select("SELECT * FROM banner")
    List<Banner> select();
    @Delete("DELETE FROM banner WHERE id=#{id}")
    void deleteById(int id);

    @Select("SELECT url FROM banner WHERE id=#{id}")
    String selectUrlById(int id);
}